<template>
	<el-main>
		<el-row :gutter="15">
			<el-col :lg="24">
				<el-card shadow="never" class="aboutTop">
					<div class="aboutTop-info">
						<img src="img/logo.png">
						<h2>ICI-IPSM</h2>
						<p>v4.0.0</p>
					</div>
				</el-card>
				<el-card shadow="never" header="System environment">
					<el-descriptions border :column="3">
						<el-descriptions-item label="Operating System">{{ softRegInfo.OS_NAME }}</el-descriptions-item>
						<el-descriptions-item label="OS Version">{{ softRegInfo.OS_VERSION }}</el-descriptions-item>
						<el-descriptions-item label="Application Server">{{ softRegInfo.serverInfo }}</el-descriptions-item>
					</el-descriptions>
				</el-card>
				<el-card shadow="never" header="Software envßironment">
					<el-descriptions border :column="3">
						<el-descriptions-item label="JDK Version">{{ softRegInfo.JAVA_VERSION }}</el-descriptions-item>
						<el-descriptions-item label="Java Home">{{ softRegInfo.JAVA_HOME }}</el-descriptions-item>
						<el-descriptions-item label="Software name">数智招商系统</el-descriptions-item>
						<el-descriptions-item label="Software Version">
							<span v-if="softRegInfo.theme=='0'">企业版</span>
							<span v-else-if="softRegInfo.theme=='1'">政务版</span>
							<span v-else-if="softRegInfo.theme=='2'">教育版</span>
							<span v-else>未知</span>
							 V4.0【2024.12.01】
						</el-descriptions-item>
						<el-descriptions-item label="Software Path">{{ softRegInfo.APP_PATH }}</el-descriptions-item>
						<el-descriptions-item label="Software copyright">@copyright中关村军民科技协同创新孵化中心</el-descriptions-item>
					</el-descriptions>
				</el-card>
				<el-card shadow="never" header="DataBase environment">
					<el-descriptions border :column="3">
						<el-descriptions-item label="Database Type">{{ softRegInfo.DB_TYPE }}</el-descriptions-item>
						<el-descriptions-item label="Database Version">{{ softRegInfo.DB_VERSION }}</el-descriptions-item>
						<el-descriptions-item label="Database Path">{{ softRegInfo.DB_PATH }}</el-descriptions-item>
					</el-descriptions>
				</el-card>
				<el-card shadow="never" header="Register Info">
					<el-descriptions border :column="3">
						<el-descriptions-item label="Authorized unit">{{ softRegInfo.REG_ORG_NAME }}</el-descriptions-item>
						<el-descriptions-item label="Date of Authorization">{{ softRegInfo.REG_DATE }}</el-descriptions-item>
						<el-descriptions-item label="Closing date">{{ softRegInfo.SERVICE_END_TIME }}</el-descriptions-item>
						<el-descriptions-item label="Account Count">{{ softRegInfo.accountCount }}</el-descriptions-item>
						<el-descriptions-item label="Machine Code">{{ softRegInfo.MACHINE_CODE }}</el-descriptions-item>
						<el-descriptions-item label="Soft SN">{{ softRegInfo.SN }}</el-descriptions-item>
						<el-descriptions-item label="Number of authorized organizations">{{ softRegInfo.ORG_COUNT }}</el-descriptions-item>
						<el-descriptions-item label="Number of authorized Account">{{ softRegInfo.USER_COUNT }}</el-descriptions-item>
						<el-descriptions-item label="Register State">
							<el-button type="success" round v-if="!softRegInfo.IS_REGIST">已注册</el-button>
							<!-- <el-button type="danger" round v-if="!softRegInfo.IS_REGIST">未注册</el-button> -->
						</el-descriptions-item>
					</el-descriptions>
				</el-card>
				<el-card shadow="never" header="dependencies">
					<el-descriptions border :column="3">
						<el-descriptions-item v-for="(value, key) in data.dependencies" :key="key" :label="key">{{value}}</el-descriptions-item>
					</el-descriptions>
				</el-card>
				<el-card shadow="never" header="devDependencies">
					<el-descriptions border :column="3">
						<el-descriptions-item v-for="(value, key) in data.devDependencies" :key="key" :label="key">{{value}}</el-descriptions-item>
					</el-descriptions>
				</el-card>
			</el-col>
		</el-row>
	</el-main>
</template>

<script>
	import packageJson from '../../../../package.json'

	export default {
		name: 'about',
		data() {
			return {
				data: packageJson,
				softRegInfo: {}
			}
		},
		mounted() {
			this.getRegInfoApi();
		},
		methods: {
			async getRegInfoApi() {
				let res = await this.$API.system.register.getRegInfo.get();
				if (res.code == 200) {
					this.softRegInfo = res.data;
				}
			},
		}
	}
</script>

<style scoped>
	.aboutTop {border:0;background: linear-gradient(to right, #8E54E9, #4776E6);color: #fff;}
	.aboutTop-info {text-align: center}
	.aboutTop-info img {width: 100px;}
	.aboutTop-info h2 {font-size: 26px;margin-top: 15px;}
	.aboutTop-info p {font-size: 16px;margin-top: 10px;}
</style>
